<include file="Public/header"/> 
<include file="Public/sidebar"/>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        添加文章
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
        <li class="active">Here</li>
      </ol>
    </section>
    <!-- Main content -->
    <section class="content">

        <div class="box ">
            <!-- /.box-header -->
            <!-- form start -->
            <form action="{:U('Admin/Post/add')}" class="form-horizontal" method="post" enctype="multipart/form-data">
              <div class="box-body">

                <div class="form-group">
                    <label class="col-sm-1 control-label">文章分类</label>
                    <div class="col-sm-10">
                      <select class="form-control" name="cate_id">
                        <option value="0">暂没分类</option>
                        <foreach name="nav" item="v">
                        <option value="{$v['id']}" <?php if($id == $v['id']) {echo 'selected="selected"' ;}?>>{$v['_name']}</option>
                        </foreach>
          
                      </select>
                    </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">名称</label>
                  <div class="col-sm-10">
                    <input type="text" name="name" class="form-control" placeholder="名称">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">缩略图</label>
                  <div class="col-sm-10">
                    <input type="file" name="thumb[]" multiple="multiple" class="form-control">
                  </div>
                </div>

                <!--div class="form-group">
                  <label class="col-sm-1 control-label">描述图(多图)</label>
                  <div class="col-sm-10">
                     <input type="file" name="photo[]" multiple="multiple" id="photo" class="form-control">
                  </div>
                </div-->

                <div class="form-group">
                  <label class="col-sm-1 control-label">描述</label>
                  <div class="col-sm-10">
                  <textarea name="description" class="form-control" rows="3" placeholder="描述 ..."></textarea>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-1 control-label">内容</label>
                  <div class="col-sm-10">
                  <script id="post-content" name="content" type="text/plain"></script>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">点击数</label>
                  <div class="col-sm-10">
                    <input type="text" name="click" class="form-control">
                  </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label">类型</label>
                    <div class="col-sm-10">
                      <select class="form-control" name="type">
                        <option value="1">type1</option>
                        <option value="2">type2</option>
                      </select>
                    </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">是否展示</label>
                  <div class="col-sm-10">
                    <span>是</span>
                    <input type="radio" name="status" value="1" checked="checked">
                        &emsp;
                    <span>否</span>
                    <input type="radio" name="status" value="0">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">排序</label>
                  <div class="col-sm-10">
                    <input type="text" name="order_number" class="form-control" placeholder="排序">
                  </div>
                </div>



                <div class="form-group">
                  <label class="col-sm-1 control-label">标签</label>
                  <div class="col-sm-10">
                    <input type="text" name="tags" class="form-control" placeholder="多个标签用英文字符;分割">
                  </div>
                </div>

                <!--div class="form-group">
                  <label class="col-sm-1 control-label">发布时间</label>
                  <div class="col-sm-10">
                    <input type="text" name="time" class="form-control">
                  </div>
                </div-->

                <!-- Date -->
                <div class="form-group">
                  <label class="col-sm-1 control-label">发布时间</label>
                  <div class="col-sm-10 input-group date" style="padding-right: 15px;padding-left: 15px;">
                    <div class="input-group-addon">
                      <i class="fa fa-calendar"></i>
                    </div>
                    <input type="text" name="time" class="form-control pull-right" id="datepicker">
                  </div>
                  <!-- /.input group -->
                </div>

                <div class="form-group">
                  <label class="col-sm-1 control-label">seo标题</label>
                  <div class="col-sm-10">
                    <input type="text" name="seo_title" class="form-control" placeholder="seo标题">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">seo关键词</label>
                  <div class="col-sm-10">
                    <input type="text" name="seo_keywords" class="form-control" placeholder="seo关键词">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">seo描述</label>
                  <div class="col-sm-10">
                  <textarea name="seo_description" class="form-control" rows="3" placeholder="seo描述 ..."></textarea>
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <a href="{:U('Admin/Post/index')}"><button type="button" class="btn btn-success">返回</button></a>
                <button type="submit" class="btn btn-success">添加</button>
              </div>
              <!-- /.box-footer -->
            </form>
        </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<include file="Public/footer"/>
<!-- bootstrap datepicker -->
  <link rel="stylesheet" href="__PUBLIC__/static/plugins/datepicker/datepicker3.css">
<!-- bootstrap datepicker -->
<script src="__PUBLIC__/static/plugins/datepicker/bootstrap-datepicker.js"></script>

<script>
//Date picker
    $('#datepicker').datepicker({
      autoclose: true
    });
</script>

<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('post-content',{
        toolbars: [
            ['fullscreen', 'source', 'undo', 'redo','bold', 'italic', 'underline','fontborder', 'strikethrough', '|','simpleupload', 'insertimage','attachment','emotion','link','unlink', '|', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote','searchreplace', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc'],
            ['inserttable','insertrow', 'insertcol','mergeright', 'mergedown','deleterow', 'deletecol','splittorows','splittocols', 'splittocells','deletecaption','inserttitle', 'mergecells', 'deletetable','insertparagraphbeforetable', 'paragraph','fontsize','fontfamily']
        ],
        initialFrameHeight:500,
        zIndex:100
    });
</script>